Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Discord.js: [ object Object ]

I have been working on improving my ticket system and got into that problem: Problem

My code is:

    await button.clicker.fetch();
    if (!button.clicker.member.roles.cache.has("859507507596230736")) return button.reply.send("Only staff can close the ticket.", true)
    var embed = new Discord.MessageEmbed()
    .setTitle("Are you sure?")
    .setDescription("Are you sure you want to close this ticket?\nThis action cannot be undone.")
    .setFooter(button.guild.name)
    .setColor("RED")
    var bu1tton = new MessageButton()
      .setStyle(`red`)
      .setEmoji(`๐Ÿ”’`)
      .setLabel(`Proceed anyway`)
      .setID("sure")
    button.reply.send({ component: bu1tton, embed: embed }, true)
  }

After I changed button.reply.send({ component: bu1tton, embed: embed }, true) to button.channel.send({ component: bu1tton, embed: embed }) it worked perfectly, although was viewable by everyone.

I understand the problem is , true but I don't understand why? Thanks in advance.

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

You have to use ephemeral: true instead of }, true)

Here is the code:

button.reply.send({ component: bu1tton, embed: embed, ephemeral: true})
about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!